
--<p1>

g_PreRes = nil
node={}
--call once when scene loaded
function initialize(scene)
  g_PreRes = scene:getResolution()
  local kuruEngineInstance = KuruEngine.getInstance()
  kuruFaceDetector = KuruFaceDetectorExtension.cast(kuruEngineInstance:getExtension('KuruFaceDetector'))
  kuruTouch = KuruTouchExtension.cast(kuruEngineInstance:getExtension('KuruTouch'))
  kuruTouch:getTouchDownEvent():addEventHandler(onTouchDown)
  
  --<p2>
 
end

--call every frame,elapsed time is the time elapsed this frame
function frameReady(scene,elapsedTime)
  --<p3>
end

--call when reset scene,e.g switch to rear camera
function reset(scene)
  --<p5>
end

--call when scene close
function finalize(scene)
  kuruTouch:getTouchDownEvent():removeEventHandler(onTouchDown)
  --<p4>
end

--call when touch screen
function onTouchDown(event)
  print('touchdown')
end

function addNodeAndRelease(scene, node)
  scene:addNode(node)
  node:release()
  return node
end

function addChildAndRelease(parent, child)
  parent:addChild(child)
  child:release()
  return child
end
